package com.ruoyi.system.domain;

import com.ruoyi.common.utils.StringUtils;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import java.text.DecimalFormat;
import java.text.Format;
import javax.persistence.Transient;

/**
 * 运单编号对象 t_number_persistence_info
 * 
 * @author ruoyi
 * @date 2023-12-08
 */
public class TNumberPersistenceInfo extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 编号ID */
    private Long numberPersistenceId;

    @Transient
    private Format decimalFormat = new DecimalFormat("000000000");

    /** 当前编号 */
    @Excel(name = "当前编号")
    private Long number;

    /** 删除标识 （0代表存在 2代表删除） */
    private String delFlag;

    public void setNumberPersistenceId(Long numberPersistenceId) 
    {
        this.numberPersistenceId = numberPersistenceId;
    }

    public Long getNumberPersistenceId() 
    {
        return numberPersistenceId;
    }
    public void setNumber(Long number)
    {
        this.number = number;
    }
    public void addOne()
    {
        this.number = number + 1;
    }

    public Long getNumber() 
    {
        return number;
    }
    public void setDelFlag(String delFlag) 
    {
        this.delFlag = delFlag;
    }

    public String getDelFlag() 
    {
        return delFlag;
    }

    public String getFormatNumber()
    {
        if(StringUtils.isNull(number)) return null;
        return decimalFormat.format(number);
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("numberPersistenceId", getNumberPersistenceId())
            .append("number", getNumber())
//            .append("formatnumber", getFormatNumber())
            .append("remark", getRemark())
            .append("delFlag", getDelFlag())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .toString();
    }
}
